using namespace std;
#include <string>
#include <cstring>
#include <cstdio>
#include <unistd.h>
#include <iostream>
#include <sys/types.h>
#include <cerrno>
#include <fcntl.h>
#include <sys/stat.h>
#include <cassert>

#define NAMED_PIPE "/tmp/mypipe.110"

bool creatFifo(const string& path)
{
    umask(0);
    int n = mkfifo(path.c_str(),0666);
    //创建成功管道文件
    if(n == 0)return true;
    else 
    {
        cout<<"errno: "<<errno<<"err string:"<<strerror(errno)<<endl;
        return false;
    }
    return false;
}

void removeFifo(const string& path)
{
    int n = unlink(path.c_str());
    assert(n == 0);
    (void)n;
}
